package framework;

import java.lang.reflect.Field;

public class FormField {
	protected String label;
	protected Field field;
	
	public FormField(Class<?> classe, String nomeCampo, String label) throws SecurityException, NoSuchFieldException{
		field = classe.getField(nomeCampo);
		this.label = label;
	}

	public FormField(Field field, String label) throws SecurityException, NoSuchFieldException{
		this.field = field;
		this.label = label;
	}
	
	public String getLabel() {
		return label;
	}

	public void setLabel(String label) {
		this.label = label;
	}

	public Field getField() {
		return field;
	}

	public void setField(Field field) {
		this.field = field;
	}

	public String gerarLinha(Object objeto) throws Exception, Throwable{
		return field.get(objeto).toString();
	};
}
